問題の説明
TensorFlow 2はcolab googleとwindows 10でバージョンを表示しません (TensorFlow 2 not show the version in colab google and windows 10)
Google Colab に TensorFlow バージョン 2 をインストールします:
!wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda‑repo‑ubuntu1604 ‑10‑0‑local‑10.0.130‑410.48_1.0‑1_amd64 ‑O cuda‑repo‑ubuntu1604‑10‑0‑local‑10.0.130‑410.48_1.0‑1_amd64.deb !dpkg ‑i cuda‑repo ‑ubuntu1604‑10‑0‑local‑10.0.130‑410.48_1.0‑1_amd64.deb !apt‑key add /var/cuda‑repo‑10‑0‑local‑10.0.130‑410.48/7fa2af80.pub !apt ‑get update !apt‑get install cuda !pip install tf‑nightly‑gpu‑2.0‑preview
しかし、バージョンを見つけようとすると、表示されます
1.13.0‑dev20190116
また、tf.enable_eager_execution() と NameError: name 'layers' is not defined を使用したいときにエラーが発生します
リファレンスソリューション
方法 1:
Try like this:
!pip install tf‑nightly‑2.0‑preview
import tensorflow as tf
As explained by Luca to check the version you need:
print(tf.__version__)
(by Farshid PirahanSiah、prosti)